<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引入VUE-->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>欢迎来到 {{ name }}</h2>
        <button @click='showInfo($event, 66)'>点我提示信息</button>

        <a href="http://www.atguigu.com" @click.prevent='showInfo'>点我跳转</a>
    </div>
</body>
<script>
    Vue.config.productionTip = false

    new Vue({
        el: '#root',
        data: {
            name: '尚硅谷'
        },
        methods: {
            showInfo(event, name) {
                console.log("event", event);
                console.log(this);
                alert(this._data.name)
            }
        },
    })
</script>
</html>